<?php 
	include "../config.php";
	include ADMIN_ROOT."templates/header.php";
	include ADMIN_ROOT."templates/left.php";
	require_once DOC_ROOT."lib/connection.php";
	include DOC_ROOT."/lib/ckeditor/ckeditor.php";
	include DOC_ROOT."/lib/ckfinder/ckfinder.php";
?>
<div id="main-content">
<?php 
		$stmt = sqlsrv_query($con,"SELECT *FROM users");
		
?>
	<table>
    	<tr>
        	<td>ID</td>
            <td>FirstName</td>
            <td>LastName</td>
            <td>Email</td>
            <td>User_Name</td>
            <td>Password</td>
            <td>Action</td>
        </tr>
     <?php 
	 	while(sqlsrv_fetch($stmt)){
			$id=sqlsrv_get_field($stmt,0);
	 ?>
     <tr>
     	<td><?=$id?></td>
        <td><?=sqlsrv_get_field($stmt,1)?></td>
        <td><?=sqlsrv_get_field($stmt,2)?></td>
        <td><?=sqlsrv_get_field($stmt,3)?></td>
        <td><?=sqlsrv_get_field($stmt,4)?></td>
        <td><?=sqlsrv_get_field($stmt,5)?></td>
        <td>
        	<a href="<?=ADMIN_URL?>post/edit.php?id=<?=$id?>">Edit</a>&nbsp;&nbsp;
            <a href="javascript:warning('<?=ADMIN_URL?>post/del.php','<?=$id?>')">Del</a>	
        </td>
     </tr>
     <?php
		}
		sqlsrv_free_stmt($stmt);
		sqlsrv_close($con);
	 ?>
     </table>
     <p> <a href="<?=ADMIN_URL?>views/adduser.php"> Add user </a></p>
</div>
</div><!-- END main-content -->
</div><!-- END wrap-content -->
</div><!-- END content -->
			
<?php
	include ADMIN_ROOT."templates/footer.php";
?>